from openr.clients.decision_client import DecisionClient
import zmq
from openr.utils import zmq_socket
from thrift.protocol.TCompactProtocol import TCompactProtocolFactory
from openr.Fib import ttypes as fib_types
import time

ctx = zmq.Context()
s = zmq_socket.ZmqSocket(ctx, zmq.SUB, -1, TCompactProtocolFactory)
s.connect("tcp://192.168.2.6:60099")
s.set_sock_opt(zmq.SUBSCRIBE, b"")

while True:
    #d = s.recv_thrift_obj(fib_types.RouteDatabase)
    s.recv()
    print(time.time())
    # print(d.thisNodeName)
    # print(d.unicastRoutes)